import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

class RegistrationManager {
    private Map<String, List<Participant>> registrationMap = new HashMap<>();

    public void registerParticipant(String competitionName, Participant participant) {
        registrationMap.computeIfAbsent(competitionName, k -> new ArrayList<>()).add(participant);
    }

    public List<Participant> getParticipantsByCompetition(String competitionName) {
        return registrationMap.getOrDefault(competitionName, new ArrayList<>());
    }

    public void cancelRegistration(String competitionName, Participant participant) {
        List<Participant> participants = registrationMap.get(competitionName);
        if (participants != null) {
            participants.remove(participant);
        }
    }
}    